package com.example.networktest


import android.provider.ContactsContract
import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.http.*

interface AppService {

    @GET("get_data.json")
    fun getAppData(): Call<List<App>>

    @GET("{page}/get_data.json")
    fun getData(@Path("page") page: Int): Call<List<App>>


    @GET("get_data.json")
    fun getData(@Query("u") user: String, @Query("t") token: String): Call<ContactsContract.Data>

    @GET("data/{id}")
    fun deleteData(@Path("id") id: String): Call<ResponseBody>

    @Headers("User-Agent: okhttp", "Cache-Control: max-age=0")
    @POST("data/create")
    fun createData(@Body app: App): Call<ResponseBody>

    @GET("get_data.json")
    fun getHeader(@Header("User-Agent") userAgent: String,@Header("Cache-control") cacheControl: String): Call<ResponseBody>
}